package net.xdclass.order.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;

public class AliPayConfig {

    /**
     * 商家信息
     * 商户账号oojfas5640@sandbox.com
     * 登录密码111111
     * 商户PID2088721028105923
     *
     * 买家账号ngovit5001@sandbox.com
     * 登录密码111111
     * 支付密码111111
     * 用户UID2088722028137062
     * 用户名称ngovit5001
     * 证件类型IDENTITY_CARD
     * 证件账号861725195600222256
     */

    /** appid */
    public static final String APPID = "9021000133697033";

    /** 支付宝网关地址 */
    public static final String ALIPAY_GETEWAY = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
    /** 支付宝公钥 */
    public static final String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhKc5N52Af964YFG9fzcUeGtSG5/mOn1UhWXFaEhy74QsKJikEnpXQ+mDtvVYrGZ7cOltvHGNSpVrFmQsEB1I5iPu8SKnSF6YV6xqXS9fpqlm057kSgpglm5bE8QrsQmZKLUKo6wCy1SabtH7vslD2heT73xu8sX4wMTvB7JQ/JiyXN3nluDMN5GBcEUt/WjzUvojWR3TbxUQSTaPVOJo60CD7tOaY3YxVchwltk/sjdGEfxlcamV5RS19ElM4+PZd58gVmTaEtcANFn2EFiI+J9VEOqxUOPMpr0LD0MPeWo8ndAmeCwTPte2+UV+8/BsIRB2CSn9913HRlj+nmYeCQIDAQAB";
    /** 应用私钥 */
    public static final String APP_PRIVATE_KEY = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCYDBVpVHqPLwIApiwK8VkUMScOmLmyRMVYApR9gxn53HqHXlLK1flzkataSfLA5zKvaJ5WHa9DktCruIxEkXC9BDfNTvrLJVpRSu7r9FFyW1dnE4/9Ks3+0eOFZXTKYFASOl9ySL0UE9YKIvWlpB3uAhk2ku99w+OFkPy12PJaUFYrDN0Hs/EqBqzOzr9Zn7a2RWm2OT2gIa+c8SJiWuVJ+6sprbl7yezI7TyB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nlXHUa3p/tHeXswJNZBul46hQcF2pcSsfEE+jcHeuseTDR/3RhXVebMFVwRRz51xRjtB8pmUGHPlJIRa50CgYApRf3ZjH9SOyAsrp0jMWZTeCysIGChnqy4znpwGe2HNqYje5hN1IYoggzs0OVLa6FVenZNTYb1LrC4bQzvPy6JxWQ++d1kXZkVgJXM/hBcHz6KKEpcZCqEZJ03OAr7QpMnz0kTy7UNbqEyQvcKTcbD3z4IgZ6xnWGIr31GuvqQCQ==";
    /** 参数返回格式 */
    public static final String FORMAT = "json";
    /** 编码集 */
    public static final String CHARSET = "UTF-8";
    /** 生成签名字符串所使用的签名算法类型 */
    public static final String SIGN_TYPE = "RSA2";

    private AliPayConfig(){}

    private static volatile AlipayClient client;

    public static AlipayClient instance(){
        if (client == null){
            synchronized (AliPayConfig.class){
                client = new DefaultAlipayClient(ALIPAY_GETEWAY, APPID, APP_PRIVATE_KEY, FORMAT, CHARSET, ALIPAY_PUBLIC_KEY, SIGN_TYPE);
            }
        }
        return client;
    }
}
